from core.tasks.TasksQueue import  *
from core.spider.SpiderFactory import  *
import time

class TaskModel:

    id = None
    def __init__(self):
        pass

if __name__ == '__main__':

    # tasksQueue = TasksQueue()
    #
    # #开始执行
    # tasksQueue.execute();
    #
    # print(tasksQueue)
    #
    # spiderTaskEngine = SpiderTaskEngine()
    #
    # tasksQueue.put(spiderTaskEngine)
    # print(tasksQueue.task_queue_count())

    taskModel  = TaskModel()
    taskModel.id = 2

    spiderFactory = SpiderFactory()
    spiderFactory.execute()

    result = spiderFactory.start(taskModel)
    print('启动结果')
    print(result)
    while True:
         time.sleep(1)
         print(spiderFactory.get_task_count())
